<?php 
include '../data/data.php';
$conn = new mysqli($config['ip'], $config['user'], $config['pass'], $config['data']);
$ID=str_replace(' ', '', $_GET['tc']);
?>
<html><head lang="en">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta name="keywords" content="H5游戏,小游戏,手机游戏,网页游戏,在线游戏,点击即玩,久乐游戏">
<meta name="description" content="久乐游戏是一个行业领先的H5在线游戏平台，玩游戏不再苦苦的等待下载，bt手游,满V手游,无限元宝手游点击即玩。">
<title>游戏中心 - bt手游,满V手游,无限元宝手游</title>
<link rel="stylesheet" href="/public/styles/base.css">
<link rel="stylesheet" href="/css/new.css">
<link rel="stylesheet" href="/styles/ranking.css">
<link rel="stylesheet" href="/styles/gm.css">
</head>
<body class="bg00">
            <div class="hfnu">
                <p style="font-size:16px;font-weight:bold;margin-left: 4%;">活动快报</p>
                <a href="/info/num"><p style="font-size:14px;float: right;margin-right:4%; ">更多</p></a>
            </div>
            <div>
                <ul class="game_news2">
                                         <?php  
$result = $conn->query("SELECT id, logo, name, date FROM info WHERE userid LIKE '%$dl%' ORDER BY renqi DESC limit 4");
 
if ($result->num_rows > 0) {
    while($row = $result->fetch_assoc()) {
$startdate=$row[date];//开始时间
$enddate=date("Y-m-d");//结束时间
$date=floor((strtotime($enddate)-strtotime($startdate))/86400);
      if($date=='0'){
      $a3='当天';
      }else{
      $a3=$date.'天前';
      }
        echo ' <li>
              <a href="/info/detail.html?info_id='.$row[id].'"><img src="'.$row[logo].'" width="120" height="70" alt="'.$row[name].'"></a>
              <article>
              <a style="color: #333;font-size: 13px;" href="/info/detail.html?info_id='.$row[id].'"><p>'.$row[name].'</p></a>
              <div>
              <span style="font-size: 12px;color: #999;">'.$a3.'</span>
              </div>
              </article>

                        </li>
                        <div style="background: #f4f4f4;height: 1px;width: 92%;margin-left: 4%;"></div>';
    }
}
?>
             

                                    </ul>
            </div>
    <!--div.container 总外框  start-->
    <div class="z_container bg01" style="">
        <!--div.z_min 内容区域 statr-->
        <div class="main">

                    <div style="width: 100%;height: 1px;background: #f4f4f4;"></div>
                            
            <!--div.game_list 游戏列表  start-->
            <section class="game_list" style="height: auto;">
                <div class="swipe" id="slider" style="visibility: visible;">
                    <div class="slide_cont swipe-wrap" style="width: 4565px;">
                        <ul id="game_list_0" class="wrap" data-index="0" style="width: 415px; left: 0px; transition-duration: 300ms; transform: translate(0px, 0px) translateZ(0px);">
                          <!-- H5 -->
   <?php  
$result = $conn->query("SELECT id, logo, name, renqi, xingji, jianjie FROM games WHERE userid LIKE '%$dl% and type='$ID'and home='1' ORDER BY pai DESC");
 
if ($result->num_rows > 0) {
    while($row = $result->fetch_assoc()) {
            if($row[xingji]=='1'){
      $xj='<i class="icons i_start1"></i>';
      }elseif($row[xingji]=='2'){
      $xj='<i class="icons i_start1"></i><i class="icons i_start1"></i>';
      }elseif($row[xingji]=='3'){
      $xj='<i class="icons i_start1"></i><i class="icons i_start1"></i><i class="icons i_start1"></i>';
      }elseif($row[xingji]=='4'){
      $xj='<i class="icons i_start1"></i><i class="icons i_start1"></i><i class="icons i_start1"></i><i class="icons i_start1"></i>';
      }elseif($row[xingji]=='5'){
      $xj='<i class="icons i_start1"></i><i class="icons i_start1"></i><i class="icons i_start1"></i><i class="icons i_start1"></i><i class="icons i_start1"></i>';
      }
        echo '<li style="">
    <section class="list_content">
        <div class="game_log relative">
            <a target="_top" href="/game/detail.html?game_id='.$row[id].'"><img src="'.$row[logo].'" width="100%" height="auto" alt="'.$row[name].'"></a>
        </div>
        <div class="game_info">
            <h3>
                <span class="hidden"><a target="_top" href="/game/detail.html?game_id='.$row[id].'" title="'.$row[name].'" style="color:#333333;">'.$row[name].'</a></span>
                            </h3>
            <p style="margin:6px 0 5px 0;">
                <a target="_top" href="/game/detail.html?game_id='.$row[id].'">
                <span class="start_list fl">
                    '.$xj.'               </span>
                <span class="" style="padding: 0 1px 0;color:#5398FD;font-size: 10px;"><span style="color: #666666;">人气：</span>'.$row[renqi].'万+</span>
                </a>
            </p>
            <a target="_top" href="/game/detail.html?game_id='.$row[id].'">
            <p>'.$row[jianjie].'</p>
            </a>
        </div>
        <div class="game_btn">
                                <a target="_top" onclick="countDownload(this,100)" style="background: #5398FD;" href="/game/detail.html?game_id='.$row[id].'" class="btn_blue">查看详情</a>
                    </div>
    </section>
</li>';
    }
}else{
   echo '';
}
?>   
                        </ul>
                        <ul id="game_list_1" class="wrap" data-index="1" style="width: 415px; left: -415px; transition-duration: 300ms; transform: translate(415px, 0px) translateZ(0px);">
<!-- 手游 -->
<?php  
$result = $conn->query("SELECT id, logo, name, renqi, xingji, jianjie FROM games WHERE userid LIKE '%$dl%' and type='$ID' and home='1' ORDER BY pai DESC");
 
if ($result->num_rows > 0) {
    while($row = $result->fetch_assoc()) {
            if($row[xingji]=='1'){
      $xj='<i class="icons i_start1"></i>';
      }elseif($row[xingji]=='2'){
      $xj='<i class="icons i_start1"></i><i class="icons i_start1"></i>';
      }elseif($row[xingji]=='3'){
      $xj='<i class="icons i_start1"></i><i class="icons i_start1"></i><i class="icons i_start1"></i>';
      }elseif($row[xingji]=='4'){
      $xj='<i class="icons i_start1"></i><i class="icons i_start1"></i><i class="icons i_start1"></i><i class="icons i_start1"></i>';
      }elseif($row[xingji]=='5'){
      $xj='<i class="icons i_start1"></i><i class="icons i_start1"></i><i class="icons i_start1"></i><i class="icons i_start1"></i><i class="icons i_start1"></i>';
      }
        echo '<li style="">
    <section class="list_content">
        <div class="game_log relative">
            <a target="_top" href="/game/detail.html?game_id='.$row[id].'"><img src="'.$row[logo].'" width="100%" height="auto" alt="'.$row[name].'"></a>
        </div>
        <div class="game_info">
            <h3>
                <span class="hidden"><a target="_top" href="/game/detail.html?game_id='.$row[id].'" title="'.$row[name].'" style="color:#333333;">'.$row[name].'</a></span>
                            </h3>
            <p style="margin:6px 0 5px 0;">
                <a target="_top" href="/game/detail.html?game_id='.$row[id].'">
                <span class="start_list fl">
                    '.$xj.'               </span>
                <span class="" style="padding: 0 1px 0;color:#5398FD;font-size: 10px;"><span style="color: #666666;">人气：</span>'.$row[renqi].'万+</span>
                </a>
            </p>
            <a target="_top" href="/game/detail.html?game_id='.$row[id].'">
            <p>'.$row[jianjie].'</p>
            </a>
        </div>
        <div class="game_btn">
                                <a target="_top" onclick="countDownload(this,100)" style="background: #5398FD;" href="/game/detail.html?game_id='.$row[id].'" class="btn_blue">查看详情</a>
                    </div>
    </section>
</li>';
    }
}else{
   echo '';
}
?>   

                        </ul>

                    </div>
                </div>
            </section>
            <!--div.game_list 游戏列表  end-->
            <div class="footer_padding"></div>
        </div>
        <!--div.z_min 内容区域 end-->
    </div>
    <!--div.container 总外框  end-->
<!--footer 底部 start-->
<footer id="footer" class="z_footer" style="">
    <nav>
        <a target="_top" href="/index.html" style="margin-left: 2%;" >
            <p class="img_1"><img src="/picture/home.png" alt=""></p>
            <p class="img_2"><img src="/picture/home1.png" alt=""></p>
            <span>首页</span>
        </a>
        <a target="_top" href="/game/type.html?tc=GM" id="footer_nav_active">
            <p class="img_1"><img src="/picture/game.png" alt=""></p>
            <p class="img_2"><img src="/picture/game1.png" alt=""></p>
            <span>GM</span>
        </a>
        <a target="_top" href="/game/game.html?tc=rm" title="">
            <p class="img_1"><img src="/picture/game.png" alt=""></p>
            <p class="img_2"><img src="/picture/game1.png" alt=""></p>
            <span>BT</span>
        </a>
        <a target="_top" href="/user/user.html" title="">
            <p class="img_1"><img src="/picture/user.png" alt=""></p>
            <p class="img_2"><img src="/picture/user1.png" alt=""></p>
            <span>我的</span>
        </a>
    </nav>
</footer>
<link href="/css/app.css" rel="stylesheet" type="text/css">
<!--二维码-->
<script src="/public/scripts/jquery-1.11.1.min.js"></script>
<script src="/public/scripts/jquery.qrcode.min.js"></script>

<!--<div class="qrcode_image">-->
<!--        <img src="/qrcode/game.html?addr=--><!--">-->
<!--</div>-->
<script>
    $('#qrcode').qrcode({
        text:"http://2252.h5.zyttx.com/game/index.html",
        width: 160, //宽度
        height:160, //高度
        background: "#ffffff",
        correctLevel: 0,//纠错等级
    });

    /**
     * 统计
     */
    // var is_weixin = (function(){return navigator.userAgent.toLowerCase().indexOf('micromessenger') !== -1})();
    // window.onload = function() {
    //     if (is_weixin) {
    //         $('#weixin_an').show();
    //     }
    // }
</script>

<script src="/public/scripts/jquery-1.11.1.min.js"></script>
<script src="/public/scripts/jquery.mobile.min.js"></script>
<script src="/jquery/swipe.js"></script>
<script>
        $(function(){
	var nomore = '<label>没有更多数据了</label>';
    var pn = [0,0,0,0,0,0,0,0,0,0,0];
    var limit = 10;
    var current = 0;
    var loading = false;
    function tc()
    {
        if( loading ) return ;
        var t = $('#game_list_'+current);
        var l = t.children('li.loading');
        if( l.children('label').length > 0 ) return ;
        loading = true;
        ++pn[current];
    }
    tc();
    $(".loading").on('tap',function(){
        tc();
    });
    var slider = new Swipe(document.getElementById('slider'), {
        auto: false,
        continuous: true,
        disableScroll: false,
        stopPropagation: false,
        callback: function(index, element) {
            $(".ranking_nav a").eq(index).addClass("chose").siblings().removeClass("chose");
            current = index;
            tc();
        }
    });
    $(".ranking_nav a").on('tap',function(){
        $(this).addClass("chose").siblings().removeClass("chose");
        slider.slide($(this).index(), 300);
    });
    $(".game_list").css({height:'auto'});

    $('#search_btn').on('tap', function(){
		var v = $.trim($('#search_ipt').val());
		v = v.replace(/[\'\"\?`~\!\$\%\^\*\(\)\[\]\{\}\-\+\\]+/, '');
		$('#search_ipt').val(v);
		if( v == '' ) {
			alert('请输入游戏名称、拼音或关键字！');
			$('#search_ipt').focus();
			return false;
		}
		location.href = '/search.html?search='+ encodeURIComponent(v);
	});
    $('#search_ipt').bind('keydown',function(event){
        if(event.keyCode == "13") {
            var v = $.trim($('#search_ipt').val());
            v = v.replace(/[\'\"\?`~\!\$\%\^\*\(\)\[\]\{\}\-\+\\]+/, '');
            $('#search_ipt').val(v);
            if( v == '' ) {
                alert('请输入游戏名称、拼音或关键字！');
                $('#search_ipt').focus();
                return false;
            }
            location.href = '/search.html?search='+ encodeURIComponent(v);
        }
    });
});
</script>
<script type="text/javascript">
    $(function(){
        $(".dgomts").click(function(){
            if($(this).hasClass("dgomts")){
                $('.top_fexed').css('height','160px');
                $(this).removeClass(" dgomts") ;
                $('.bnoi').html( "点击隐藏分类" );
            }else{
                $('.top_fexed').css('height','120px');
                $(this).addClass(" dgomts") ;
                $('.bnoi').html( "点击查看全部分类" );
            }
        });
    });

</script>
<script>
    $("#search_ipt").mousedown(function(){
        $('.history').css("display","block");;
    });
</script>
<script>
    window.onpageshow = function(){
        var result = window.location.href;
        var resu = result.substr(result.length-1,1);
        var resus = result.substr(result.length-7,5);
            if (resus=='ordes'){
                $('.ranking_nav>a').removeClass('chose');
                $('.ranking_nav').children().eq(resu).addClass('chose');
            }

    };
</script>

</body></html>